#pragma once

#include "core/noncopy.h"
#include "math/coord.hpp"

#include <string>
#include <vector>
#include <functional>

namespace renderit
{
	namespace client
	{
		class iconsole : public core::noncopy
		{
		public:
			/*
			 * set input listener
			 */
			virtual void set_input_listener(std::function<void(const std::string&)> l) { input_listener_ = l; }

			/*
			 * tell current position
			 */
			virtual math::coord curr_pos() const { return math::coord(); }

			/*
			 * set cursor
			 */
			virtual bool set_curr_pos(const math::coord& pos) { return false; }

			/*
			 * write to current position
			 */
			virtual iconsole * write(const std::string& content) { return this; }

			/*
			 * write to current position
			 */
			virtual iconsole * write(const char * fmt, ...) { return this; }

			/*
			 * clear current line
			 */
			virtual void clear_line() {}

			/*
			 * back to last line and clear
			 */
			virtual void back_line() {}

		protected:
			std::function<void(const std::string&)> input_listener_;
		};
	}
}